﻿{% extends "super.html" %}
{% block title %}员工管理{% endblock %}
{% block s1 %}active{% endblock %}
{% block titlehref %}index{% endblock %}
{% block titlename %}全局动态{% endblock %}
{% block subtitlehref %}{% endblock %}
{% block subtitlename %}员工管理{% endblock %}
{% block content %}
<script type="text/javascript" src="static/myjs/myemail.js"></script>
<section id="main-content">
	<section class="wrapper site-min-height">
		<!-- BEGIN ROW  -->
		<div class="row" id="t1">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading">
						<button class="btn btn-success" disabled>我的申请</button>

						<button class="btn btn-success pull-right" data-toggle="modal" data-target="#myModal">发起新的申请
						</button>
					</header>
					<div class="panel-body">
						<div class="adv-table">
							<table class="display table table-bordered table-striped" id="example1">
								<thead>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>处理状态</th>
								</tr>
								</thead>
								<tbody>
								{%for i in list%}
								<tr>
									<td>
										{%if i.Type == 1%}
										<span class="label label-success">事假</span>
										{%endif%}
										{%if i.Type == 2%}
										<span class="label label-danger">病假</span>
										{%endif%}
										{%if i.Type == 3%}
										<span class="label label-warning">婚假</span>
										{%endif%}
										{%if i.Type == 4%}
										<span class="label label-warning">工伤假</span>
										{%endif%}
										{%if i.Type == 5%}
										<span class="label label-warning">丧假</span>
										{%endif%}
									</td>
									<td style="width: 30%">{{i.Content}}</td>
									<td style="width: 10%">{{i.Sid}}</td>
									<td style="width: 10%">{{i.Sname}}</td>
									<td style="width: 15%">{{i.Create_time}}</td>
									<td>
										{%if i.Result == 1%}
										<span class="label label-success">通过</span>
										{%endif%}
										{%if i.Result == 2%}
										<span class="label label-danger">不通过</span>
										{%endif%}
										{%if i.Result == 0%}
										<span class="label label-warning">处理中</span>
										{%endif%}
									</td>
								</tr>
								{%endfor%}
								</tbody>
								<tfoot>
								<tr>
									<th>标题</th>
									<th>内容</th>
									<th>申请人ID</th>
									<th>申请人姓名</th>
									<th>申请日期</th>
									<th>处理状态</th>
								</tr>
								</tfoot>
							</table>
						</div>
					</div>
				</section>
			</div>
		</div>

		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
		     aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							编辑申请内容
						</h4>
					</div>
					<div class="modal-body">
						<form id="createrequest" action="email" method="post">
							<div class="panel-body">
								<input id="option" name="option" value="CCC" hidden>
								<input id="sid" name="sid" value="{{uid}}" hidden>
								<input id="sname" name="sname" value="{{name}}" hidden>
								<input id="state" name="state" value="1" hidden>
								<input id="type" name="type" hidden>

								<div class="form-group">
									<label for="exampleInputPassword1">类型</label>
									<br>
									<div class="btn-group" data-toggle="buttons">
										<label class="btn btn-default active" onclick="ShowTips(1)">
											<input class="sex" type="radio" id="option1" checked>
											事假
										</label>
										<label class="btn btn-default" onclick="ShowTips(2)">
											<input class="sex" type="radio" id="option2">
											病假
										</label>
										<label class="btn btn-default" onclick="ShowTips(3)">
											<input class="sex" type="radio" id="option3">
											婚假
										</label>
										<label class="btn btn-default" onclick="ShowTips(4)">
											<input class="sex" type="radio" id="option4">
											工伤假
										</label>
										<label class="btn btn-default" onclick="ShowTips(5)">
											<input class="sex" type="radio" id="option5">
											丧假
										</label>
									</div>
								</div>


								<div class="form-group">
									<label for="exampleInputPassword1">内容</label>
									<textarea rows="4" type="text" class="form-control" id="content" name="content"
									          placeholder="请输入原因详情"></textarea>
								</div>
								<div class="form-group">
									<label for="exampleInputPassword1">相关规定</label><br>
									<span style="font-size: large" id="rule"></span>
								</div>
							</div>
						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭
						</button>
						<button id="create" type="button" class="btn btn-primary">
							提交
						</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
		</div>
		<!-- END ROW  -->
	</section>
</section>

<script>
	<!-- DATATABLE JS  -->
	$(document).ready(function () {
		$('#example1').dataTable({
			"aaSorting": [[4, "desc"]]
		});
		$('#example2').dataTable({
			"aaSorting": [[4, "desc"]]
		});
	});
</script>
{% endblock%}